import Vue from 'vue';
import {
  get,
  post,
  upload
} from '@/utils/request';
export function getKaUserInfo(userId) {
  return get({
    url: Vue.prototype.$conf.baseUrl + '/direct/getKaUserInfo?userId=' + userId
  });
}
export function cities(code) {
  return get({
    url: Vue.prototype.$conf.baseUrl + '/pca/cities?provinceCode=' + code
  });
}
export function areas(code) {
  return get({
    url: Vue.prototype.$conf.baseUrl + '/pca/areas?cityCode=' + code
  });
}

// 查询客户名称
export function newSearchKaUserLikeName(parm) {
  return post({
    url: Vue.prototype.$conf.baseUrl + '/kaCustomer/newSearchKaUserLikeName',
    data: parm
  });
}

// 查询历史地址
export function getKaUserAddressBook(parm) {
  return post({
    url: Vue.prototype.$conf.baseUrl + '/kaCustomer/getKaUserAddressBook',
    data: parm
  });
}

// 新增地址
export function operationadress(parm) {
  return upload({
    url: Vue.prototype.$conf.baseUrl + '/kaCustomer/operationadress',
    data: parm
  });
}

// 获取优惠券信息
export function selLottery(userId) {
  return get({
    url: Vue.prototype.$conf.baseUrl + '/lcka/coupon/selLottery?kaUserID=' + userId
  });
}

//获取合同发票类型
export function getBdHTInvoiceConfig(type) {
  return get({
    url: Vue.prototype.$conf.baseUrl + '/api/v1/invoice/getWechatInvoiceConfig?kaUserId=' + type
  });
}

//获取发票类型
export function getBdInvoiceConfig(Id) {
  return get({
    url: Vue.prototype.$conf.baseUrl + '/api/v1/invoice/getWechatInvoiceConfig?kaUserId=' + Id
  });
}

// 精拼报价回显
export function getPrices(parm) {
  return post({
    url: Vue.prototype.$conf.baseUrl + '/direct/getPrice',
    data: parm
  });
}

// 合同客户报价回显
export function getContractPrice(parm) {
  return post({
    url: Vue.prototype.$conf.baseUrl + '/direct//getContractPrice',
    data: parm
  });
}

// 新增下单
export function addOrder(parm) {
  return post({
    url: Vue.prototype.$conf.baseUrl + '/direct/addOrder',
    data: parm
  });
}

// 根据手机号码获取用户信息
export function getUserByMobile(mobile) {
  return get({
    url: Vue.prototype.$conf.baseUrl + '/kaCustomer/getUserByMobile?mobile=' + mobile
  });
}

// 根据手机号码获取用户信息
export function getWaiterInfoByName(parm) {
  return get({
    url: Vue.prototype.$conf.baseUrl + '/kaCustomer/getWaiterInfoByName?waiterName=' + parm
  });
}

// bd-h5新增用户接口
export function addUserFromBdH5(parm) {
  return post({
    url: Vue.prototype.$conf.baseUrl + '/kaCustomer/addUserFromBdH5',
    data: parm
  });
}

// 网络站点接口
export function stations(parm) {
  return post({
    url: Vue.prototype.$conf.baseUrl + '/docking/short/stations',
    data: parm
  });
}

// 确认保存
export function confirmSaveModifyOrder(parm) {
  return post({
    url: Vue.prototype.$conf.baseUrl + '/direct/confirmSaveModifyOrder',
    data: parm
  });
}